package com.future.hedongjun.home.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;

import com.future.hedongjun.home.activity.ClassExerciseItemActivity;
import com.future.hedongjun.home.bean.QuestionBean;
import com.future.hedongjun.home.fragment.QuestionItemFragment;

import java.util.List;

/**
 * Date：2018/12/3 11:16
 * author: liu.p.f
 * Describe：
 */
public class QuestionItemAdapter  extends FragmentStatePagerAdapter {
    Context context;
    List<QuestionBean> questionBeanList;
    ViewPager mViewPager;
    public QuestionItemAdapter(FragmentManager fm, List<QuestionBean> mQuestionBeen, ViewPager viewPager) {
        super(fm);
        this.questionBeanList=mQuestionBeen;
        this.mViewPager=viewPager;
    }

    @Override
    public Fragment getItem(int index) {
        QuestionItemFragment questionItemFragment=new QuestionItemFragment();
        questionItemFragment.setList(questionBeanList.get(index),index,mViewPager);
        return questionItemFragment;
    }

    @Override
    public int getCount() {
        return questionBeanList.size()+1;
    }
}
